package com.tan.springcloud.Controller;

import com.tan.springcloud.Service.HystrixService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@Slf4j
@RestController
public class OrderHystrxController {
    @Resource
    private HystrixService hystrixService;
    @GetMapping("/order/get/{id}")
    public String getHystrixService(@PathVariable("id") Integer id) {
        String hystrix = hystrixService.getHystrix(id);
        log.info("*********"+hystrix);
        return hystrix;
    }
    @GetMapping("/order01/get/{id}")
    public String getHystrixService01(@PathVariable("id") Integer id) {
        String hystrix = hystrixService.getHystrixSleep(id);
        log.info("*********"+hystrix);
        return hystrix;
    }
}
